[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
                              Erase procedure

  DECLARATION:  Erase(var F);

      PURPOSE:  Erases an external file.

         UNIT:  System

      REMARKS:  The file F must first be associated with a file variable
                of any type.  The external file associated with F is erased.

                NOTE: With {$I-}, errors are returned through IOResult

 RESTRICTIONS:  Open files cannot be erased.

      EXAMPLE:  Var
                   F     : File;
                   FileName : String;

                Begin
                   Write('Enter filename to erase: ');
                   Readln(FileName);
                   Assign(F,Filename);
                   {$I-}
                   Erase(F);
                   {$I+}
                   If IOResult <> 0 then
                     Writeln('Error *** File Not Erased');
                End.

See Also: Assign Append Close EOLN EOF Erase Reset ReWrite
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson